package com.longdaji.decoration.di.component;

import android.app.Application;

import com.longdaji.decoration.DecorationApplication;
import com.longdaji.decoration.data.DataManager;
import com.longdaji.decoration.data.db.DBHelperImp;
import com.longdaji.decoration.data.network.HttpHelperImp;
import com.longdaji.decoration.data.prefs.PrefsHelperImp;
import com.longdaji.decoration.di.module.ActivityBindingModule;
import com.longdaji.decoration.di.module.ApplicationModule;
import com.longdaji.decoration.di.module.HttpModule;

import javax.inject.Singleton;

import dagger.BindsInstance;
import dagger.Component;
import dagger.android.AndroidInjector;
import dagger.android.support.AndroidSupportInjectionModule;

/**
 * Created by longtao on 2017/12/26.
 */

@Singleton
@Component(modules = {ApplicationModule.class,
        ActivityBindingModule.class,
        AndroidSupportInjectionModule.class, HttpModule.class})
public interface AppComponent extends AndroidInjector<DecorationApplication> {
    DataManager getDataManager(); //数据中心

    HttpHelperImp httpHelper();  //提供http的帮助类

    DBHelperImp dbHelper();    //提供数据库帮助类

    PrefsHelperImp prefsHelper(); //提供sp帮助类
    @Component.Builder
    interface Builder {

        @BindsInstance
        AppComponent.Builder application(Application application);

        AppComponent build();
    }
}